var e = require("../../../utils/function.js"), t = getApp(), a = (require("../../../api.js"), 
wx.createInnerAudioContext());

a.obeyMuteSwitch = !1;

Page({
    data: {
        time: 10,
        order: {}
    },
    onLoad: function(e) {
        var a = this, o = setInterval(function() {
            if (a.data.time > 0) a.setData({
                time: --a.data.time
            }); else {
                clearTimeout(o);
                for (var e = wx.getStorageSync("order"), t = null, n = 0; n < e.length; n++) console.log(e[n].status), 
                7 === e[n].status && (console.log(e[n]), t = e[n]);
                a.setData({
                    order: t
                }), a.setData({
                    time: 10
                });
            }
        }, 1e3);
        e.uid && t.shareCouponsMessage(e.uid);
    },
    onReady: function() {},
    onShow: function() {
        for (var e = wx.getStorageSync("order"), t = null, a = 0; a < e.length; a++) console.log(e[a].status), 
        7 === e[a].status && (console.log(e[a]), t = e[a]);
        this.setData({
            order: t
        });
    },
    intoPageHandler: function(t) {
        wx.showToast({
            title: "预约成功"
        }), wx.setStorageSync("appointment_order", this.data.order), e.intoPageHandler(t.currentTarget.dataset.skip);
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {
        var e = t.shareAppMessage().title, a = t.shareAppMessage().imageUrl, o = t.shareAppMessage().desc, n = t.shareAppMessage().path;
        return console.log(t.shareAppMessage()), {
            title: e,
            imageUrl: a,
            desc: o,
            path: n
        };
    }
});